package com.fita.scheduler.dao;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Update;
import com.demo2do.core.persistence.annotation.Variable;
import com.fita.scheduler.entity.Supplier;
import com.fita.scheduler.entity.UserWallet;

/**
 * @description:
 * @author: 11200
 * @date: 2019/9/6
 */
@Dao
public interface UserWalletDao {

    @Query("SELECT id, amount, frozen_amount, last_modify_time, agent_company_id FROM user_wallet WHERE id = :id")
    UserWallet load(@Variable("id") Long id);

    @Update("UPDATE user_wallet SET amount = :amount, frozen_amount = :frozenAmount, last_modify_time = :lastModifyTime WHERE id = :id")
    void consume(UserWallet userWallet);
}
